<docs>
 <docs-title> 横向柱状图示例一</docs-title>
 <docs-desc>单个配置：data itemStyle</docs-desc>
</docs>

<template>
  <chart :options="options"></chart>
</template>

<script>
import chart from "@/echart/bar/bar1.vue";
export default {
  components: {
    chart
  },
  data() {
    return {
      options: null
    };
  },
  mounted() {
    this.init();
  },
  methods: {
    init() {
      this.options = {
        yAxis: [
          {
            data: ["1", "2", "3", "4", "5", "6", "7"]
          },
          {
            data: [50, 30, 24, 18, 35, 47, 60]
          }
        ],
        series: [
          {
            itemStyle: {
              color: {
                type: "linear",
                x: 1,
                y: 0,
                x2: 0,
                y2: 0,
                colorStops: [
                  {
                    offset: 0,
                    color: "red" // 0% 处的颜色
                  },
                  {
                    offset: 1,
                    color: "blue" // 100% 处的颜色
                  }
                ],
                global: false // 缺省为 false
              }
            },
            data: [50, 30, 24, 18, 35, 47, 60]
          }
        ]
      };
    }
  }
};
</script>
